<template>
    <div class="ta">
        <a href="" class="home" @click="$emit('change',0),hui()">
            <img :src="home">
        </a>
        <div class="head headb">
            <img :src="tit">
        </div>
        <div class="position" v-show="show === 0">
            <ul>
                <li v-for="(item,index) in position" :key="index" v-show="ti === index">
                    <h1>{{item.a}}</h1>
                    <p v-for="(_item,_index) in item.b" :key="_index">
                        <input type="radio" name="dan" :value="_item.val" @input="fan = $event.target.value">
                        {{_item.aa}}
                    </p>
                </li>
            </ul>
            <span class="none" :style="none">
                您还没选择！
            </span>
            <a href="###" class="sure" @click="judje()">确定</a>
        </div>
        <Answer :active='active' :ti='ti' :show='show' @changeT='changeT' @changeS='changeS'></Answer>
    </div>
</template>
<script>
import Answer from './Answer';
export default {
    components:{Answer},
    props:['tit','val'],
    
    methods:{
        judje(){
            console.log(this.show)
            if(this.fan==='true'){
                this.active=0;
                this.show=1;
                this.none="display: none";
            }else if(this.fan=== 'false'){
                this.active=1;
                this.show=1;
                this.none="display: none";
            }else if(this.fan!='true'&& 'false'){
                this.none="display: block";
            }
        },
        hui(){
            if(this.val===0){
                this.active=0
            }
            console.log(this.val)
        },
        changeT(index){
            this.ti=index;
        },
        changeS(index){
            this.show=index;
        }
    },
    data(){
        return {
            ti:0,
            none:'display:none',
            fan:4,
            active:1,
            show:0,
            home:require('@/assets/home.png'),
            position:[
                {
                    a:'1、十八大修改党章遵循的原则____。',
                    b:[
                        {
                            aa:'A.坚持以马克思列宁主义、毛泽东思想、邓小平理论、“三个代表”重要思想和科学发展观为指导',
                            val:false,
                        },
                        {
                            aa:'B.坚持发扬党内民主，集中全党智慧',
                            val:false,
                        },
                        {
                            aa:'C.保持党章总体稳定，只修改那些必须改的，在党内已经形成共识的内容',
                            val:false
                        },
                        {
                            aa:'D.以上都是',
                            val:true
                        }
                    ]
                },
                {
                    a:'2、十八大提出要建设学习型、服务型、____马克思主义执政党等新内容。',
                    b:[
                        {
                            aa:'A.活力型的',
                            val:false
                        },
                        {
                            aa:'B.和谐型的',
                            val:false
                        },
                        {
                            aa:'C.小康型的',
                            val:false
                        },
                        {
                            aa:'D.创新型的',
                            val:true
                        },
                    ]
                }
            ],
        }
    },
}
</script>
<style>
.ta{
    width: 100%;
    height: 100%;
}
.home{
    display: block;
    width: 100%;
    height: 90px;
    margin-top: 30px;
    text-align: right;
}
.home>img{
    width: 86px;
    height: 86px;
    margin-right: 30px;
}
.ta .headb{
    margin-top: 44px;
}
.position{
    width: 600px;
    margin: 30px auto 0;
}
.position>ul{
    width: 100%;
    color: #fff;
    box-sizing: border-box;
    padding: 20px;
    border-radius: 6px;
    background: #ef6565;
}
.position>ul>li{
    width: 100%;
    color: #fff;
    line-height: 36px;
    font-size: 30px;
}
.position>ul>li>h1{
    font-size: 30px;
    padding-bottom: 10px;
    font-weight: 700;
    margin-bottom: 12px;
}
.position>ul>li>p{
    margin-bottom: 12px;
}
.position>ul>li>p>input{
    width: 22px;
    height: 22px;
}
.sure{
    background: url('../../assets/dj_bg.png') no-repeat;
    width: 323px;
    margin: 0 auto;
    margin-top: 20px;
    height: 89px;
    line-height: 74px;
    color: #d22f28;
    font-size: 30px;
    text-align: center;
    display: block;
}
.none{
    display: block;
    text-align: center;
    font-size: 30px;
    height: 36px;
    line-height: 36px;
    color: #fff;
    margin-top: 30px;
}

</style>